<rss version="2.0" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
    <channel>
        <title>Dynamisys</title> 
        <link>https://www.dynamisys.co.uk</link> 
        <description>RSS feeds for Dynamisys</description> 
        <ttl>60</ttl> <item>
    <comments>https://www.dynamisys.co.uk/Articles-Downloads/Articles/ID/160/FastEndpoints-returns-BadRequest-on-a-Get#Comments</comments> 
    <slash:comments>0</slash:comments> 
    <wfw:commentRss>https://www.dynamisys.co.uk/DesktopModules/DnnForge%20-%20NewsArticles/RssComments.aspx?TabID=723&amp;ModuleID=1621&amp;ArticleID=160</wfw:commentRss> 
    <trackback:ping>https://www.dynamisys.co.uk:443/DesktopModules/DnnForge%20-%20NewsArticles/Tracking/Trackback.aspx?ArticleID=160&amp;PortalID=22&amp;TabID=723</trackback:ping> 
    <title>FastEndpoints returns BadRequest on a Get</title> 
    <link>https://www.dynamisys.co.uk/Articles-Downloads/Articles/ID/160/FastEndpoints-returns-BadRequest-on-a-Get</link> 
    <description>I spent a fruitless evening trying to track down why my get request returned the badrequest result.Using FastEndpoints under net 9.Discovered that a get, with the content-type header application/json, seems to cause this problem. I conjecture that it&#39;s because gets normally have no body. I suspect the FastEndpoints code tries to deserialize an empty body as JSON. This results in a JSON parsing error; returned to the client as a bad request.Removing the content type header fixed the problem for me.</description> 
    <dc:creator>RichardHowells</dc:creator> 
    <pubDate>Thu, 19 Jun 2025 16:06:00 GMT</pubDate> 
    <guid isPermaLink="false">f1397696-738c-4295-afcd-943feb885714:160</guid> 
    
</item>
<item>
    <comments>https://www.dynamisys.co.uk/Articles-Downloads/Articles/ID/117/Octopus-Deploy-and-Net-core-ASPNETCORE_ENVIRONMENT-setting#Comments</comments> 
    <slash:comments>0</slash:comments> 
    <wfw:commentRss>https://www.dynamisys.co.uk/DesktopModules/DnnForge%20-%20NewsArticles/RssComments.aspx?TabID=723&amp;ModuleID=1621&amp;ArticleID=117</wfw:commentRss> 
    <trackback:ping>https://www.dynamisys.co.uk:443/DesktopModules/DnnForge%20-%20NewsArticles/Tracking/Trackback.aspx?ArticleID=117&amp;PortalID=22&amp;TabID=723</trackback:ping> 
    <title>Octopus Deploy and .Net core. ASPNETCORE_ENVIRONMENT setting</title> 
    <link>https://www.dynamisys.co.uk/Articles-Downloads/Articles/ID/117/Octopus-Deploy-and-Net-core-ASPNETCORE_ENVIRONMENT-setting</link> 
    <description>When an ASP.Net core application runs it inspects the ASPNETCORE_ENVIRONMENT environment variable to determine if it is running in development mode or production (or other) modes.

This can be set from a variety of places.&nbsp; In .Net core 3 (maybe other versions) it can be set from the web config file...

&nbsp; &nbsp; &nbsp; &lt;environmentVariables&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &lt;!--This environment variable is overwritten from Launchsettings.json when you press F5 in Visual Studio--&gt;
&nbsp; &nbsp; &nbsp; &nbsp; &lt;!--It is also overwritten by Octopus Deploy by a custom script step--&gt;&nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &lt;environmentVariable name=&quot;ASPNETCORE_ENVIRONMENT&quot; value=&quot;Development&quot; /&gt;
&nbsp; &nbsp; &nbsp; &lt;/environmentVariables&gt;
&nbsp;

But that value in the web config is also meddled with when you hit F5 in Visual Studio, where it gets overwritten by a value in launchsettings.json (only used by visual studio - not required on the live&nbsp;server).

Octopus deploy would be very happy if it said...

&nbsp; &nbsp; &nbsp; &nbsp; &lt;environmentVariable name=&quot;ASPNETCORE_ENVIRONMENT&quot; value=&quot;{OctopusVariable}&quot; /&gt;
&nbsp;

...Octopus is excellent at finding those variables and subbing values in there.&nbsp; This does not work because every time you hit F5 the octopus variable gets overwritten with a value from launchsettings

So I added a custom deployment step to my Octopus Deploy based on Benjamin Tam&#39;s script&nbsp;https://library.octopus.com/step-templates/c7f96ab8-a0d3-4f01-928e-c8cb78ab108c/&nbsp;

I puzzled for AGES over&nbsp;finding out the directory that the .Net Core app was deployed, by a previous step,&nbsp;so that I could reference the web config file.&nbsp; This worked for me...

#{Octopus.Action[ASP.Net Core Website].Output.Package.InstallationDirectoryPath}\web.config

Where &quot;ASP.Net Core Website&quot; is the actual name of the step deploying the .Net core website, as displayed in the Octopus UI.&nbsp; I may not have made the perfect choice of Octopus&nbsp;internal variable, but it works for my simple requirements.

I also had to patch the script.&nbsp; For me; the path in the web.config xml down to the environment variable section had to be corrected.

Original:&nbsp;$aspNetCore = $xml.configuration.location.&#39;system.webServer&#39;.aspNetCore

Modified by me:&nbsp;$aspNetCore = $xml.configuration.&#39;system.webServer&#39;.aspNetCore

&nbsp;
</description> 
    <dc:creator>RichardHowells</dc:creator> 
    <pubDate>Thu, 09 Apr 2020 15:53:00 GMT</pubDate> 
    <guid isPermaLink="false">f1397696-738c-4295-afcd-943feb885714:117</guid> 
    
</item>
<item>
    <comments>https://www.dynamisys.co.uk/Articles-Downloads/Articles/ID/116/ASPNet-Core-Identity--Invalid-token-on-password-reset#Comments</comments> 
    <slash:comments>0</slash:comments> 
    <wfw:commentRss>https://www.dynamisys.co.uk/DesktopModules/DnnForge%20-%20NewsArticles/RssComments.aspx?TabID=723&amp;ModuleID=1621&amp;ArticleID=116</wfw:commentRss> 
    <trackback:ping>https://www.dynamisys.co.uk:443/DesktopModules/DnnForge%20-%20NewsArticles/Tracking/Trackback.aspx?ArticleID=116&amp;PortalID=22&amp;TabID=723</trackback:ping> 
    <title>ASP.Net Core Identity - Invalid token on password reset</title> 
    <link>https://www.dynamisys.co.uk/Articles-Downloads/Articles/ID/116/ASPNet-Core-Identity--Invalid-token-on-password-reset</link> 
    <description>I had Scaffolded some of the Identity code - so that I could send out emails for password resets.&amp;nbsp; The sent out reset tokens did not work.&amp;nbsp; I always saw the message &amp;#39;Invalid token&amp;#39;. I&amp;#39;m not sure how I got to this state... How I fixed it I scaffolded the Account/ResetPassword as well.&amp;nbsp; It&amp;nbsp;worked for me to just run Add | Scaffolded Item | Identity and choose Account/ResetPassword. In the code for that I discovered (around line 60) that it was Base64 decoding the incoming&amp;nbsp;token.&amp;nbsp; My emailed out token&amp;nbsp;didn&amp;#39;t Base64 encode it. I removed the Base64 decoding from the scaffolded code.&amp;nbsp; The emailed out tokens began working. Environment : ASP.Net Core 3, but the project was upgraded from version 2.&amp;nbsp; I&amp;#39;m pretty sure that the emailed out password tokens used to work and I don&amp;#39;t know at what point they stopped. </description> 
    <dc:creator>RichardHowells</dc:creator> 
    <pubDate>Thu, 09 Apr 2020 15:37:00 GMT</pubDate> 
    <guid isPermaLink="false">f1397696-738c-4295-afcd-943feb885714:116</guid> 
    
</item>

    </channel>
</rss>